<template>
  <div class="title flex shrink">
    <div class="icon">
      <slot name="icon">
        <img
          :src="PIC_URL + '/tlbypcWeb/home/spyg.png'"
          @error="
            $fn.imageHandler(path + '/client/home/images/spyg.png', $event)
          "
        />
      </slot>
    </div>
    <div class="flex name" @click="link">
      <span>{{ name }}</span>
    </div>
    <i class="grow"></i>
    <div class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script>
import { CLIENT } from "@/common/const";
export default {
  props: ["name"],
  data() {
    return {
      path: CLIENT,
    };
  },
  methods: {
    link() {
      this.$emit("link");
    },
  },
};
</script>

<style scoped lang="scss">
.title {
  padding: 15px;
  border-bottom: 1px solid #323337;
  align-items: center;
  height: 58px;
  box-sizing: border-box;
  background: #27282e;
  .name {
    font-weight: bold;
    align-items: center;
    font-size: 20px;
    color: #bcbfc4;
  }
}
.right {
  font-size: 18px;
  color: #bcbfc4;
  a:hover {
    color: #bcbfc4;
  }
}
</style>
